﻿using System;
using System.Collections.Generic;
using Shop.Base.Entity;
using Shop.Base.Entity.Delete;
using Shop.Base.Entity.Insert;
using Shop.Base.Entity.Update;
using Shop.Entity;
using Shop.Interface;

namespace Shop.Base.Interface
{
    public interface ISystemUser:IBase
    {
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="user">修改信息</param>
        /// <param name="com">操作人信息</param>
        /// <returns>true/false </returns>
        bool Update(UpdateSystemUser user, ComUser com);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="user">修改信息</param>
        /// <param name="com">操作人信息</param>
        /// <returns>true/false </returns>
        bool Insert(AddSystemUser user, ComUser com);

        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="name"></param>
        /// <param name="englishName"></param>
        /// <param name="account"></param>
        /// <param name="isLogin"></param>
        /// <param name="isNormal"></param>
        /// <param name="isDel"></param>
        /// <param name="pageIndex">当前第几页</param>
        /// <param name="pageSize">每页显示数量</param>
        /// <param name="total">输出总数</param>
        /// <returns></returns>
        List<SystemUserPo> GetPage(string name, string englishName, string account, int isLogin , int isNormal , int isDel, int pageIndex, int pageSize , out int total);

        /// <summary>
        /// 系统登录
        /// </summary>
        /// <param name="login">登录信息</param>
        /// <returns>用户信息</returns>
        SystemUserPo Login(UserLogin login);

        /// <summary>
        /// 初始化密码
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="pwd">加密后的密码</param>
        /// <param name="com">操作人</param>
        /// <returns>true/false </returns>
        bool InitPasswd(Guid userId, string pwd, ComUser com);

        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="user">修改信息</param>
        bool ChangePassword(SystemUserPo user);
    }
}